#region Copyright Notice
// 
// 
//  
//  Copyright (c) 2009-2011 Anindya Chatterjee
//  
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//  
//      http://www.apache.org/licenses/LICENSE-2.0
//  
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
// 
// 
#endregion
using System;
using System.Runtime.Serialization;

namespace AbstractClass.Collections.Generic
{
    /// <summary>
    /// The exception that is thrown when trying to add an element into a <see cref="Pocket&lt;T&gt;"/>when it is already full.
    /// </summary>
    [Serializable]
    public class PocketOverflowException : Exception
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PocketOverflowException"/> class.
        /// </summary>
        public PocketOverflowException() : base(LanguageResource.PocketIsFull)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="PocketOverflowException"/> class.
        /// </summary>
        /// <param name="message">A message that describes the error.</param>
        public PocketOverflowException(string message) : base(message)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="PocketOverflowException"/> class.
        /// </summary>
        /// <param name="message">A message that describes the error.</param>
        /// <param name="innerException">The exception that is the cause of the current exception. 
        /// If the innerException parameter is not a null reference, the current exception is 
        /// raised in a catch block that handles the inner exception.</param>
        public PocketOverflowException(string message, Exception innerException)
            : base(message, innerException)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="PocketOverflowException"/> class.
        /// </summary>
        /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
        /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
        /// <exception cref="T:System.ArgumentNullException">
        /// The <paramref name="info"/> parameter is null.
        /// </exception>
        /// <exception cref="T:System.Runtime.Serialization.SerializationException">
        /// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
        /// </exception>
        protected PocketOverflowException(
            SerializationInfo info,
            StreamingContext context) : base(info, context)
        {
        }
    }
}